package com.study.happystudy.mapper;

import com.study.happystudy.po.File;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface FileMapper {
    void uploadFile(@Param("fileImg") String fileImg,
            @Param("fileName") String fileName,
                    @Param("fileType") String fileType,
                    @Param("fileContent") String fileContent);

    void copyFileToCourse(@Param("courseId") int courseId, @Param("fileId") int fileId);

    void copyFileToUser(@Param("userId") int userId, @Param("fileId") int fileId);

    void deleteFileFromCourse(@Param("fileId") int fileId, @Param("courseId") int courseId);

    void deleteFileFromUser(@Param("fileId") int fileId, @Param("userId") int userId);

    File getFileById(@Param("fileId") int fileId);

    void deleteFileById(@Param("fileId") int fileId);

    List<File> getFilesByNameInCourse(@Param("fileName") String fileName, @Param("courseId") int courseId);

    List<File> getFilesByNameInUser(@Param("fileName") String fileName, @Param("userId") int userId);

    List<File> getFilesByUserId(@Param("userId") int userId);

    List<File> getFilesByCourseId(@Param("courseId") int courseId);
}
